<?php
    $textHTML = "";
    $textHTML .= "<div id='news'>";
    $ban = Chemins::IMAGES .'actualite_ban.png';
    $textHTML .= "<img id='ban' src='$ban' />";
    foreach (VariablesGlobales::$lesNews as $uneNews){
        $id = $uneNews->id;
        $titre = $uneNews->titre;
        $corp = substr($uneNews->corp, 0, 40) . "...";
        $date = $uneNews->date;
        $image = Chemins::IMAGES_NEWS . $uneNews->image;
        $auteur = $uneNews->auteur;

        $textHTML .= "<div id='uneNews'>";
        $textHTML .= "<a href='index.php?controleur=News&action=afficher&news=$id'>";
        $textHTML .= "<img src='$image' title='$titre' /></a>";
        $textHTML .= "<a href='index.php?controleur=News&action=afficher&news=$id' id='titreNews'>$titre</a>";
        $textHTML .= "<p>$corp</p>";
        $textHTML .= "<h2>Le $date.</h2>";
        $textHTML .= "</div>";
    }
    $textHTML .= "</div>";
    echo $textHTML;
?>
